﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class admin_LoadThongSo : System.Web.UI.Page
{
    private DataSet objDataSet;
    protected void Page_Load(object sender, EventArgs e)
    {
        string loaisp = Request.QueryString["loaisp"];
        LoaiSanPhamBUS objLoaiSP = new LoaiSanPhamBUS(TGDDConfiguration.DbConnectionString);
        objDataSet = objLoaiSP.SelectTenLoaiSanPham(int.Parse(loaisp));
        DataRow row = objDataSet.Tables[0].Rows[0];
        string tenloaisp = row["TenLoaiSanPham"].ToString();
        Control c = null;
        switch (tenloaisp)
        {
            case "CPU":
                c = Page.LoadControl(Request.ApplicationPath +
                       "/admin/ThongSo/TH_LoadThongSo_CPU.ascx");
                loadThongSoHolder.Controls.Add(c);
                break;
            case "MAINBOARD":
                c = Page.LoadControl(Request.ApplicationPath +
                       "/admin/ThongSo/TH_LoadThongSo_MAINBOARD.ascx");
                loadThongSoHolder.Controls.Add(c);
                break;
            case "KEYBOARD":
                c = Page.LoadControl(Request.ApplicationPath +
                       "/admin/ThongSo/TH_LoadThongSo_KEYBOARD.ascx");
                loadThongSoHolder.Controls.Add(c);
                break;
            case "MOUSE":
                c = Page.LoadControl(Request.ApplicationPath +
                       "/admin/ThongSo/TH_LoadThongSo_MOUSE.ascx");
                loadThongSoHolder.Controls.Add(c);
                break;
            case "HE_DIEU_HANH":
                c = Page.LoadControl(Request.ApplicationPath +
                       "/admin/ThongSo/TH_LoadThongSo_HE_DIEU_HANH.ascx");
                loadThongSoHolder.Controls.Add(c);
                break;
            case "MONITOR":
                c = Page.LoadControl(Request.ApplicationPath +
                       "/admin/ThongSo/TH_LoadThongSo_MONITOR.ascx");
                loadThongSoHolder.Controls.Add(c);
                break;
            case "CASE":
                c = Page.LoadControl(Request.ApplicationPath +
                       "/admin/ThongSo/TH_LoadThongSo_CASE.ascx");
                loadThongSoHolder.Controls.Add(c);
                break;
            case "CD_DVD":
                c = Page.LoadControl(Request.ApplicationPath +
                       "/admin/ThongSo/TH_LoadThongSo_CD.ascx");
                loadThongSoHolder.Controls.Add(c);
                break;
            case "HDD":
                c = Page.LoadControl(Request.ApplicationPath +
                       "/admin/ThongSo/TH_LoadThongSo_HDD.ascx");
                loadThongSoHolder.Controls.Add(c);
                break;
            case "POWER":
                c = Page.LoadControl(Request.ApplicationPath +
                       "/admin/ThongSo/TH_LoadThongSo_POWER.ascx");
                loadThongSoHolder.Controls.Add(c);
                break;
            case "SPEAKER":
                c = Page.LoadControl(Request.ApplicationPath +
                       "/admin/ThongSo/TH_LoadThongSo_SPEAKER.ascx");
                loadThongSoHolder.Controls.Add(c);
                break;
            case "VGA":
                c = Page.LoadControl(Request.ApplicationPath +
                       "/admin/ThongSo/TH_LoadThongSo_VGA.ascx");
                loadThongSoHolder.Controls.Add(c);
                break;
            case "RAM":
                c = Page.LoadControl(Request.ApplicationPath +
                       "/admin/ThongSo/TH_LoadThongSo_RAM.ascx");
                loadThongSoHolder.Controls.Add(c);
                break;
            case "SOUND_CARD":
                c = Page.LoadControl(Request.ApplicationPath +
                       "/admin/ThongSo/TH_LoadThongSo_SOUNDCARD.ascx");
                loadThongSoHolder.Controls.Add(c);
                break;
        }
    }
}
